package oop.ex2.method;

import java.util.regex.Pattern;

import oop.ex2.main.Main;

public enum inBlock {
	IF("if\\s*\\(+(\\S+)\\)+\\{"),
	WHILE("while\\s*\\(+(\\S+)\\)+\\{"),
	VARIABLEDEC(Main.VAR_REGEX),
	VARIABLEINIT("\\s*(\\S+)\\s*=\\s*(\\S+)\\s*;"),
	METHODCALL("\\s*(\\S+)\\(\\s*(\\S+)\\s*\\)\\s*;");
	private final Pattern patt;
	
	/**
	 * Construct a new enum with the desired pattern
	 * @param pattern the pattern in string form
	 */
	private inBlock(String pattern) {
		this.patt=Pattern.compile(pattern);
	}

	/**
	 * returns the pattern
	 * @return the pattern
	 */
	public Pattern getPatt() {
		return patt;
	}
}
